export default {
	data() {
		return {
			id: '',
			detail: {}
		}
	},
	onLoad(options) {
		this.id = options.id;
		this.getOrderDetail();
	},
	onShow() {},
	onHide() {},
	onPullDownRefresh() {
		this.getOrderDetail();
		uni.stopPullDownRefresh()
	},
	methods: {
		async getOrderDetail() {
			if (!this.id) return;
			const dataRes = await this.$http.claim$api$order_detail({
				id: this.id,
			});
			if (dataRes) {
				console.log("dataRes = ", dataRes);
				this.detail = dataRes;
			}
		},
		copyPhone() {
			const copyTxt = this.detail.phone;
			this.copyText(copyTxt);
		},
		copyExpress() {
			const copyTxt = this.detail.express_no;
			this.copyText(copyTxt);
		},
		copyText(copyTxt) {
			uni.setClipboardData({
				data: copyTxt,
				showToast: false,
				success: function() {
					console.log('copyOrderNo success : ', value);
				},
				fail: function(err) {
					console.error('复制失败：', err);
				}
			});
		},

	}
}